package com.flying.exceptiion;

import java.io.UnsupportedEncodingException;

/**
 * @ClassName: Student
 * @author: 刘鹏飞
 * @date 2023/7/28 9:00
 * @Description:
 */
public class Student extends Person{

    public Student(String name, int age) {
        super(name, age);
    }

    @Override
    public void test() {
        super.test();
    }

    @Override
    public void demo() {

    }
    /*
    * 1. 子类要抛出和父类一样的异常
    * 2. 父类没有抛异常,子类不能抛异常
    *    子类有异常,自己解决.
    * */
    @Override
    public void foo() throws UnsupportedEncodingException /*IOException*/ {
        // 子类抛出的异常不能高于父类的异常
        super.foo();
    }

    @Override
    public void bar() {
        super. bar();
    }
}
